<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<div style="width: 800px; margin:auto"  align="center">
    <h2 style="text-align: center"> 人员信息提交表 </h2>
    <form style="background-color: #226422;" action="addinfo" method="post">
        @csrf
        <input type="hidden" name="id" value="{{isset($uqur)?$uqur->id:0}}">

        姓名： <input type="text" name="name" value="{{isset($uqur)?$uqur->name:''}}"><br>
        年龄： <input type="number" name="age" value="{{isset($uqur)?$uqur->age:''}}"><br>
        性别： <input type="radio" name="sex" value="1" {{isset($uqur)?($uqur->sex==1?'checked':''):''}}> 男
        <input type="radio" name="sex" value="2" {{isset($uqur)?($uqur->sex==2?'checked':''):''}}> 女 <br>
        家乡： <select name="hometown">
            <option {{isset($uqur)?'':'selected'}}> --请选择-- </option>
            <option value="1" {{isset($uqur)?($uqur->hometown==1?'selected':''):''}} > 北京 </option>
            <option value="2" {{isset($uqur)?($uqur->hometown==2?'selected':''):''}} > 上海 </option>
            <option value="3" {{isset($uqur)?($uqur->hometown==3?'selected':''):''}}> 天津 </option>
            <option value="4" {{isset($uqur)?($uqur->hometown==4?'selected':''):''}}> 深圳 </option>
            <option value="5" {{isset($uqur)?($uqur->hometown==5?'selected':''):''}}> 乌鲁木齐 </option>
            <option value="6" {{isset($uqur)?($uqur->hometown==6?'selected':''):''}}> 喀什 </option>
        </select><br>
        兴趣： <input type="checkbox" name="hobby[]" value="1" {{isset($uqur)?((in_array('1',explode("*",$uqur->hobby))?'checked':'')):''}}> 读书
        <input type="checkbox" name="hobby[]" value="2" {{isset($uqur)?((in_array('2',explode("*",$uqur->hobby))?'checked':'')):''}}> 编程
        <input type="checkbox" name="hobby[]" value="3" {{isset($uqur)?((in_array('3',explode("*",$uqur->hobby))?'checked':'')):''}}> 打工
        <input type="checkbox" name="hobby[]" value="4" {{isset($uqur)?((in_array('4',explode("*",$uqur->hobby))?'checked':'')):''}}> 游泳
        <input type="checkbox" name="hobby[]" value="5" {{isset($uqur)?((in_array('5',explode("*",$uqur->hobby))?'checked':'')):''}}> 花钱<br>
        简历： <textarea cols="50" rows="10" name="description">{{isset($uqur)?$uqur->description:''}}</textarea><br><br>
        <input type="submit">
    </form>
</div>
</body>
</html>

